#include "SRbodyItem.h"

CSRbodyItem::CSRbodyItem(void)
{
}

CSRbodyItem::~CSRbodyItem(void)
{
}

void CSRbodyItem::LoadData()
{
	CYQCFile* is = new CYQCFile();
	is->Open(SRBODYITEMFILE);

	int MapListCount = is->ReadShortReverse();

	CSRbodyItemData* itemdata = new CSRbodyItemData();
	itemdata->autorelease();
	s_RbodyItemAll = new CCMutableArray<CSRbodyItemData*>(MapListCount);
	
	for (int i=0;i<MapListCount;i++)
	{
		is->ReadShortReverse();
		int value = is->ReadIntReverse();
		itemdata->setType(value);

		value = is->ReadIntReverse();
		itemdata->setdensity(value/100.0f);
		s_RbodyItemAll->addObject(itemdata);
	}
}

CCMutableArray<CSRbodyItemData*>* CSRbodyItem::s_RbodyItemAll = NULL;



float CSRbodyItemData::getdensity()
{
	return m_density;
}

void CSRbodyItemData::setdensity( float value )
{
	m_density = value;
}
